<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.8"/>
<title>embedme: Network类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">embedme
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.8 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>首页</span></a></li>
      <li class="current"><a href="annotated.html"><span>类</span></a></li>
      <li><a href="files.html"><span>文件</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>类列表</span></a></li>
      <li><a href="classes.html"><span>类索引</span></a></li>
      <li><a href="hierarchy.html"><span>类继承关系</span></a></li>
      <li><a href="functions.html"><span>类成员</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="#pub-static-methods">静态 Public 成员函数</a> &#124;
<a href="class_network-members.html">所有成员列表</a>  </div>
  <div class="headertitle">
<div class="title">Network类 参考</div>  </div>
</div><!--header-->
<div class="contents">

<p>网络类,提供对网络设别的常用操作.  
 <a href="class_network.html#details">更多...</a></p>

<p><code>#include &lt;<a class="el" href="_network_8h_source.html">Network.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:a71b6065c80dfb6c819287c959045d2ae"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a71b6065c80dfb6c819287c959045d2ae"></a>
std::string&#160;</td><td class="memItemRight" valign="bottom"><b>getSubnetIP</b> (const std::string gatewayIP, const std::string subnetMask, sint32 subIndex)</td></tr>
<tr class="separator:a71b6065c80dfb6c819287c959045d2ae"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
静态 Public 成员函数</h2></td></tr>
<tr class="memitem:a0e0558dc6c5301761cf4299142e71cd1"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0e0558dc6c5301761cf4299142e71cd1"></a>
static bool&#160;</td><td class="memItemRight" valign="bottom"><b>isValidIP</b> (const std::string ip)</td></tr>
<tr class="separator:a0e0558dc6c5301761cf4299142e71cd1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a32387be250c452d4753104c35feef396"><td class="memItemLeft" align="right" valign="top">static std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_network.html#a32387be250c452d4753104c35feef396">getInetAddr</a> (const std::string intf)</td></tr>
<tr class="memdesc:a32387be250c452d4753104c35feef396"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取网口ip地址  <a href="#a32387be250c452d4753104c35feef396">更多...</a><br /></td></tr>
<tr class="separator:a32387be250c452d4753104c35feef396"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac5383fcfa9c6e1ca9054023764dd8bc1"><td class="memItemLeft" align="right" valign="top">static std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_network.html#ac5383fcfa9c6e1ca9054023764dd8bc1">getMaskAddr</a> (const std::string intf)</td></tr>
<tr class="memdesc:ac5383fcfa9c6e1ca9054023764dd8bc1"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取网口子网掩码地址  <a href="#ac5383fcfa9c6e1ca9054023764dd8bc1">更多...</a><br /></td></tr>
<tr class="separator:ac5383fcfa9c6e1ca9054023764dd8bc1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a398762dc97e710378366dc7644332a99"><td class="memItemLeft" align="right" valign="top">static std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_network.html#a398762dc97e710378366dc7644332a99">getMacAddr</a> (const std::string intf)</td></tr>
<tr class="memdesc:a398762dc97e710378366dc7644332a99"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取网口mac地址  <a href="#a398762dc97e710378366dc7644332a99">更多...</a><br /></td></tr>
<tr class="separator:a398762dc97e710378366dc7644332a99"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5be3dd99aaae9dfd86ea2460b5e17514"><td class="memItemLeft" align="right" valign="top">static sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_network.html#a5be3dd99aaae9dfd86ea2460b5e17514">getIfUpDown</a> (const std::string intf)</td></tr>
<tr class="memdesc:a5be3dd99aaae9dfd86ea2460b5e17514"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取网口状态  <a href="#a5be3dd99aaae9dfd86ea2460b5e17514">更多...</a><br /></td></tr>
<tr class="separator:a5be3dd99aaae9dfd86ea2460b5e17514"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae34c41b000df924c0d2ec597f1299786"><td class="memItemLeft" align="right" valign="top">static sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_network.html#ae34c41b000df924c0d2ec597f1299786">setInetAddr</a> (const std::string intf, const std::string ipaddr)</td></tr>
<tr class="memdesc:ae34c41b000df924c0d2ec597f1299786"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置网口ip地址  <a href="#ae34c41b000df924c0d2ec597f1299786">更多...</a><br /></td></tr>
<tr class="separator:ae34c41b000df924c0d2ec597f1299786"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a17fb128c761e6aa129818ac29eb01852"><td class="memItemLeft" align="right" valign="top">static sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_network.html#a17fb128c761e6aa129818ac29eb01852">setMaskAddr</a> (const std::string intf, const std::string netmask)</td></tr>
<tr class="memdesc:a17fb128c761e6aa129818ac29eb01852"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置网口子网掩码地址  <a href="#a17fb128c761e6aa129818ac29eb01852">更多...</a><br /></td></tr>
<tr class="separator:a17fb128c761e6aa129818ac29eb01852"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa6bf9ae4135cdd1941a4af0d153b69f4"><td class="memItemLeft" align="right" valign="top">static sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_network.html#aa6bf9ae4135cdd1941a4af0d153b69f4">setMacAddr</a> (const std::string intf, const std::string mac)</td></tr>
<tr class="memdesc:aa6bf9ae4135cdd1941a4af0d153b69f4"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置网口mac地址  <a href="#aa6bf9ae4135cdd1941a4af0d153b69f4">更多...</a><br /></td></tr>
<tr class="separator:aa6bf9ae4135cdd1941a4af0d153b69f4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a28633da6000b20a86816b11b1f6b2a8b"><td class="memItemLeft" align="right" valign="top">static sint32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_network.html#a28633da6000b20a86816b11b1f6b2a8b">setIfUpDown</a> (const std::string intf, sint32 upOrDown)</td></tr>
<tr class="memdesc:a28633da6000b20a86816b11b1f6b2a8b"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置网口状态  <a href="#a28633da6000b20a86816b11b1f6b2a8b">更多...</a><br /></td></tr>
<tr class="separator:a28633da6000b20a86816b11b1f6b2a8b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2c8eac1c0493e3a2748e3a2f23586978"><td class="memItemLeft" align="right" valign="top">static std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_network.html#a2c8eac1c0493e3a2748e3a2f23586978">dhcpClientGetIP</a> (const std::string intf)</td></tr>
<tr class="memdesc:a2c8eac1c0493e3a2748e3a2f23586978"><td class="mdescLeft">&#160;</td><td class="mdescRight">dhcp动态获取ip地址  <a href="#a2c8eac1c0493e3a2748e3a2f23586978">更多...</a><br /></td></tr>
<tr class="separator:a2c8eac1c0493e3a2748e3a2f23586978"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4a512e9f3c683c1c3d1d17505c2cb28f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4a512e9f3c683c1c3d1d17505c2cb28f"></a>
static sint32&#160;</td><td class="memItemRight" valign="bottom"><b>checkSubnetIP</b> (const std::string gatewayIP, const std::string subnetMask, std::string &amp;subnetIP)</td></tr>
<tr class="separator:a4a512e9f3c683c1c3d1d17505c2cb28f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6a4fc6f794478f1ec0a07f414049bbdb"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6a4fc6f794478f1ec0a07f414049bbdb"></a>
static sint32&#160;</td><td class="memItemRight" valign="bottom"><b>getIfLinkUpDown</b> (const std::string intf)</td></tr>
<tr class="separator:a6a4fc6f794478f1ec0a07f414049bbdb"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>网络类,提供对网络设别的常用操作. </p>
</div><h2 class="groupheader">成员函数说明</h2>
<a class="anchor" id="a2c8eac1c0493e3a2748e3a2f23586978"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::string Network::dhcpClientGetIP </td>
          <td>(</td>
          <td class="paramtype">const std::string&#160;</td>
          <td class="paramname"><em>intf</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>dhcp动态获取ip地址 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">intf</td><td>网口名称,如eth0 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>动态获取成功返回IP地址字符串,获取失败返回空字符串 </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="a5be3dd99aaae9dfd86ea2460b5e17514"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">sint32 Network::getIfUpDown </td>
          <td>(</td>
          <td class="paramtype">const std::string&#160;</td>
          <td class="paramname"><em>intf</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>获取网口状态 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">intf</td><td>网口名称,如eth0 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回网口状态(INTF::DOWN或者INTF::UP),获取失败返回STATUS_ERROR </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="a32387be250c452d4753104c35feef396"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::string Network::getInetAddr </td>
          <td>(</td>
          <td class="paramtype">const std::string&#160;</td>
          <td class="paramname"><em>intf</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>获取网口ip地址 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">intf</td><td>网口名称,如eth0 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>IP地址字符串,获取失败返回空字符串 </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="a398762dc97e710378366dc7644332a99"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::string Network::getMacAddr </td>
          <td>(</td>
          <td class="paramtype">const std::string&#160;</td>
          <td class="paramname"><em>intf</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>获取网口mac地址 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">intf</td><td>网口名称,如eth0 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>mac地址字符串,获取失败返回空字符串 </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="ac5383fcfa9c6e1ca9054023764dd8bc1"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::string Network::getMaskAddr </td>
          <td>(</td>
          <td class="paramtype">const std::string&#160;</td>
          <td class="paramname"><em>intf</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>获取网口子网掩码地址 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">intf</td><td>网口名称,如eth0 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>IP地址字符串,获取失败返回空字符串 </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="a28633da6000b20a86816b11b1f6b2a8b"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">sint32 Network::setIfUpDown </td>
          <td>(</td>
          <td class="paramtype">const std::string&#160;</td>
          <td class="paramname"><em>intf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">sint32&#160;</td>
          <td class="paramname"><em>upOrDown</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>设置网口状态 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">intf</td><td>网口名称,如eth0 </td></tr>
    <tr><td class="paramname">upOrDown</td><td>INTF::DOWN或者INTF:UP </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回STATUS_OK,获取失败返回STATUS_ERROR </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="ae34c41b000df924c0d2ec597f1299786"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">sint32 Network::setInetAddr </td>
          <td>(</td>
          <td class="paramtype">const std::string&#160;</td>
          <td class="paramname"><em>intf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string&#160;</td>
          <td class="paramname"><em>ipaddr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>设置网口ip地址 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">intf</td><td>网口名称,如eth0 </td></tr>
    <tr><td class="paramname">ipaddr</td><td>ip地址字符串 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>设置成功返回STATUS_OK,失败返回STATUS_ERROR </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="aa6bf9ae4135cdd1941a4af0d153b69f4"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">sint32 Network::setMacAddr </td>
          <td>(</td>
          <td class="paramtype">const std::string&#160;</td>
          <td class="paramname"><em>intf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string&#160;</td>
          <td class="paramname"><em>mac</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>设置网口mac地址 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">intf</td><td>网口名称,如eth0 </td></tr>
    <tr><td class="paramname">mac</td><td>mac地址字符串 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>设置成功返回STATUS_OK,失败返回STATUS_ERROR </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="a17fb128c761e6aa129818ac29eb01852"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">sint32 Network::setMaskAddr </td>
          <td>(</td>
          <td class="paramtype">const std::string&#160;</td>
          <td class="paramname"><em>intf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string&#160;</td>
          <td class="paramname"><em>netmask</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>设置网口子网掩码地址 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">intf</td><td>网口名称,如eth0 </td></tr>
    <tr><td class="paramname">netmask</td><td>子网掩码ip地址字符串 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>设置成功返回STATUS_OK,失败返回STATUS_ERROR </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>libemb/inc/<a class="el" href="_network_8h_source.html">Network.h</a></li>
<li>libemb/src/Network.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
生成于 2016年 七月 7日 星期四 19:49:39 , 为 embedme使用  &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.8
</small></address>
</body>
</html>
